from itertools import accumulate
from typing import List


class Solution:
    def corpFlightBookings(self, bookings: List[List[int]], n: int) -> List[int]:
        result = [0] * n
        for first, last, seats in bookings:
            result[first - 1] += seats
            if last < n:
                result[last] -= seats
        return list(accumulate(result))


if __name__ == '__main__':
    S = Solution()
    r = S.corpFlightBookings(bookings=[[1, 2, 10], [2, 3, 20], [2, 5, 25]], n=5)
    print(r)
